///*
// * Copyright 2013 David Schreiber
// *           2013 John Paul Nalog
// *
// *    Licensed under the Apache License, Version 2.0 (the "License");
// *    you may not use this file except in compliance with the License.
// *    You may obtain a copy of the License at
// *
// *        http://www.apache.org/licenses/LICENSE-2.0
// *
// *    Unless required by applicable law or agreed to in writing, software
// *    distributed under the License is distributed on an "AS IS" BASIS,
// *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// *    See the License for the specific language governing permissions and
// *    limitations under the License.
// */
//
//package com.funny.learning.english.adapter;
//
//import java.util.ArrayList;
//
//import android.content.Context;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.ImageView;
//import android.widget.LinearLayout;
//import android.widget.TextView;
//
//import com.funny.learning.english.R;
//import com.funny.learning.english.cover_flow.FancyCoverFlow;
//import com.funny.learning.english.cover_flow.FancyCoverFlowAdapter;
//import com.funny.learning.english.model.HomeEntity;
//
//public class FancyCoverFlowSample1Adapter extends FancyCoverFlowAdapter {
//
//    // =============================================================================
//    // Private members
//    // =============================================================================
//    // =============================================================================
//    // Supertype overrides
//    // =============================================================================
//	private ArrayList<HomeEntity> arrData;
//	private LayoutInflater inflater;
//	private Context context;
//	private int pos;
//	
//	
//	public FancyCoverFlowSample1Adapter(Context context, ArrayList<HomeEntity> arrData, int pos) {
//		this.arrData = arrData;
//		inflater = LayoutInflater.from(context);
//		this.context = context;
//		this.pos = pos;
//	}
//	
//    @Override
//    public int getCount() {
//        return arrData.size();
//    }
//
//    @Override
//    public HomeEntity getItem(int i) {
//        return arrData.get(i);
//    }
//
//    @Override
//    public long getItemId(int i) {
//        return i;
//    }
//
//    @Override
//    public View getCoverFlowItem(int i, View reuseableView, ViewGroup viewGroup) {
//    	if(reuseableView == null){
//    		reuseableView = inflater.inflate(R.layout.flow_item,viewGroup, false);
//    	}
//    	LinearLayout rlIndex = (LinearLayout)reuseableView.findViewById(R.id.rlIndex);
//    	ImageView ivTopic = (ImageView)reuseableView.findViewById(R.id.ivTopic);
//    	TextView tvTopic = (TextView)reuseableView.findViewById(R.id.tvTopic);
//    	
//    	int heightLayout = context.getResources().getDimensionPixelSize(R.dimen.home_layout_height);
//    	int widthLayout = context.getResources().getDimensionPixelSize(R.dimen.home_layout_width);
//// 		int widthImage = (int) (heightImage);
// 		
// 		
//    	rlIndex.setLayoutParams(new FancyCoverFlow.LayoutParams(widthLayout,heightLayout));
//    	
//    	HomeEntity homeEntity = arrData.get(i);
//    	if(homeEntity != null){
//    		ivTopic.setImageResource(homeEntity.getSrcImg());
//    		tvTopic.setText(homeEntity.getName());
//    	}
//    	
//    	
//    	
//    	if(pos != i){
//    		rlIndex.setBackgroundResource(R.drawable.stroke_img_topic);
//    	}else{
//    		rlIndex.setBackgroundResource(R.drawable.stroke_img_topic_selected);
//    	}
//    	
////        ImageView imageView = null;
////
////        if (reuseableView != null) {
////            imageView = (ImageView) reuseableView;
////        } else {
////            imageView = new ImageView(viewGroup.getContext());
////            imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
////            
////            int heightImage = context.getResources().getDimensionPixelSize(R.dimen.height);
////    		int widthImage = (int) (heightImage * 1.2);
////            
////            imageView.setLayoutParams(new FancyCoverFlow.LayoutParams(widthImage,heightImage));
////        }
////        imageView.setImageResource(this.getItem(i));
//        return reuseableView;
//    }
//    
//    public void setPos(int pos){
//    	this.pos = pos;
//    	notifyDataSetChanged();
//    }
//}
